/* ═══════════════════════════════════════════
   ViveApps — Shared Design System
   ═══════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  --bg:       #07090f;
  --bg1:      #0c0f1a;
  --bg2:      #111525;
  --bg3:      #161c2e;
  --bg4:      #1b2238;
  --border:   #1e2840;
  --border2:  #253050;
  --text:     #e8ecf5;
  --muted:    #7b8db0;
  --dim:      #3d4f70;
  --blue:     #4f8eff;
  --blue2:    #7aadff;
  --purple:   #9b7dff;
  --purple2:  #c4b0ff;
  --teal:     #2dd4bf;
  --green:    #34d399;
  --amber:    #fbbf24;
  --red:      #f87171;
  --gold:     #f0c040;
  --r:        14px;
  --r2:       10px;
  --r3:       8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow:    0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.6);
  --glow-blue: 0 0 20px rgba(79,142,255,.25);
  --glow-purple: 0 0 20px rgba(155,125,255,.2);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Typography ── */
.t-hero   { font-size: clamp(36px, 6vw, 60px); font-weight: 900; letter-spacing: -.04em; line-height: 1.1; }
.t-h1     { font-size: clamp(26px, 4vw, 36px); font-weight: 900; letter-spacing: -.03em; line-height: 1.2; }
.t-h2     { font-size: 22px; font-weight: 800; letter-spacing: -.025em; }
.t-h3     { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.t-h4     { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.t-body   { font-size: 14.5px; line-height: 1.7; color: var(--muted); }
.t-small  { font-size: 12.5px; color: var(--muted); }
.t-label  { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.grad-text {
  background: linear-gradient(135deg, var(--blue2), var(--purple2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Announcement Bar ── */
.ann-bar {
  background: linear-gradient(90deg, rgba(79,142,255,.15), rgba(155,125,255,.12));
  border-bottom: 1px solid rgba(79,142,255,.18);
  padding: 9px 24px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 13px; font-weight: 600;
}
.ann-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  background: rgba(79,142,255,.22); color: var(--blue2);
  font-size: 11px; font-weight: 700;
}
.ann-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); animation: blink 1.4s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7,9,15,.92); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.top-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 18px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 900; font-size: 18px; letter-spacing: -.03em; flex-shrink: 0;
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #4f8eff, #9b7dff);
  display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff;
  box-shadow: 0 0 18px rgba(79,142,255,.38);
}
.logo em { color: var(--blue2); font-style: normal; }
.topnav { display: flex; gap: 1px; }
.topnav a {
  padding: 7px 13px; font-size: 13.5px; color: var(--muted);
  border-radius: 8px; font-weight: 500; transition: .15s;
}
.topnav a:hover { color: var(--text); background: var(--bg3); }
.topnav a.active { color: var(--text); background: var(--bg3); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: var(--r3); font-size: 13.5px; font-weight: 600;
  transition: .18s; cursor: pointer;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; box-shadow: 0 2px 14px rgba(79,142,255,.32);
}
.btn-primary:hover { box-shadow: 0 4px 22px rgba(79,142,255,.52); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--border2); color: var(--muted); background: transparent; }
.btn-ghost:hover { color: var(--text); border-color: var(--blue); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 13px 28px; font-size: 15px; font-weight: 700; border-radius: var(--r2); }

/* ── Cards ── */
.card {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--r); transition: .18s;
}
.card:hover { border-color: rgba(79,142,255,.3); transform: translateY(-1px); }
.card-pad { padding: 22px 24px; }

/* ── Badges & Pills ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}
.badge-blue   { background: rgba(79,142,255,.12);  color: var(--blue2);   border: 1px solid rgba(79,142,255,.2); }
.badge-purple { background: rgba(155,125,255,.12); color: var(--purple2); border: 1px solid rgba(155,125,255,.2); }
.badge-green  { background: rgba(52,211,153,.12);  color: var(--green);   border: 1px solid rgba(52,211,153,.2); }
.badge-amber  { background: rgba(251,191,36,.12);  color: var(--amber);   border: 1px solid rgba(251,191,36,.2); }
.badge-dim    { background: var(--bg3); color: var(--dim); border: 1px solid var(--border); }
.badge-live   { background: rgba(52,211,153,.12);  color: var(--green);   border: 1px solid rgba(52,211,153,.25); }
.badge-locked { background: var(--bg3); color: var(--dim); border: 1px solid var(--border); }

.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-dot.live { animation: blink 1.4s infinite; }

/* ── Section Label ── */
.sec-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: var(--bg3); color: var(--dim); border: 1px solid var(--border);
  margin-bottom: 14px;
}

/* ── Layout Utilities ── */
.container  { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 72px 0; }
.divider    { border: none; border-top: 1px solid var(--border); }
.grid-2     { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.grid-3     { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4     { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.flex       { display: flex; align-items: center; }
.flex-col   { display: flex; flex-direction: column; }
.gap-4      { gap: 4px; }  .gap-8  { gap: 8px; }   .gap-12 { gap: 12px; }
.gap-16     { gap: 16px; } .gap-20 { gap: 20px; }  .gap-24 { gap: 24px; }

/* ── Hero (shared) ── */
.hero-bg-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px; opacity: .22;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black, transparent);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black, transparent);
}
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(79,142,255,.11), transparent),
    radial-gradient(ellipse 40% 60% at 85% 80%,  rgba(155,125,255,.06), transparent),
    radial-gradient(ellipse 40% 40% at 15% 70%,  rgba(45,212,191,.04), transparent);
}

/* ── Tags ── */
.tag {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
  background: var(--bg3); color: var(--dim); border: 1px solid var(--border);
}
.tag-blue   { background: rgba(79,142,255,.1);  color: var(--blue2);   border-color: rgba(79,142,255,.2); }
.tag-purple { background: rgba(155,125,255,.1); color: var(--purple2); border-color: rgba(155,125,255,.2); }
.tag-green  { background: rgba(52,211,153,.1);  color: var(--green);   border-color: rgba(52,211,153,.2); }

/* ── Form Elements ── */
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label { font-size: 13.5px; font-weight: 700; color: var(--text); }
.form-hint  { font-size: 12px; color: var(--dim); }
.form-req   { color: var(--red); margin-left: 2px; }
.input, .textarea, .select {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 11px 14px;
  color: var(--text); font-size: 14px; outline: none; transition: .15s;
  width: 100%;
}
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--blue); background: var(--bg3); }
.input.error, .textarea.error { border-color: var(--red); }
.textarea { resize: vertical; min-height: 100px; line-height: 1.7; }
.select { appearance: none; cursor: pointer; }
.char-count { font-size: 11.5px; color: var(--dim); text-align: right; margin-top: 4px; }
.field-error { font-size: 12px; color: var(--red); margin-top: 4px; display: none; }
.field-error.show { display: block; }

/* ── Stats Strip ── */
.stats-strip {
  background: var(--bg1);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); }
.stat-item { padding: 22px 24px; text-align: center; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-val { font-size: 28px; font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.stat-val em { font-style: normal; color: var(--blue2); }
.stat-lbl { font-size: 12.5px; color: var(--muted); margin-top: 5px; font-weight: 500; }
.stat-note { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* ── Page Tabs ── */
.page-tabs-wrap { border-bottom: 1px solid var(--border); }
.page-tabs { display: flex; gap: 0; overflow-x: auto; }
.page-tab {
  padding: 13px 20px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .15s;
  white-space: nowrap; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.page-tab:hover { color: var(--text); }
.page-tab.active { color: var(--text); border-bottom-color: var(--blue); }
.page-tab .sub { font-size: 11px; font-weight: 500; opacity: .7; }
.page-tab.active .sub { color: var(--blue2); opacity: 1; }

/* ── Empty State ── */
.empty-state {
  background: var(--bg1); border: 1px dashed var(--border2);
  border-radius: var(--r); padding: 56px 32px; text-align: center;
}
.empty-icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 20px;
  background: linear-gradient(135deg, rgba(79,142,255,.14), rgba(155,125,255,.1));
  border: 2px dashed rgba(79,142,255,.28); display: grid; place-items: center; font-size: 26px;
}
.empty-title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.empty-desc { font-size: 14px; color: var(--muted); line-height: 1.7; max-width: 360px; margin: 0 auto 24px; }

/* ── Footer ── */
.site-footer {
  background: var(--bg1); border-top: 1px solid var(--border);
  padding: 36px 24px;
}
.footer-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-logo { font-size: 16px; font-weight: 900; letter-spacing: -.02em; color: var(--muted); }
.footer-logo em { color: var(--blue2); font-style: normal; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--dim); transition: .15s; }
.footer-links a:hover { color: var(--muted); }
.footer-copy { font-size: 12px; color: var(--dim); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .top-inner { padding: 0 16px; }
  .topnav { display: none; }
  .container, .container-sm { padding: 0 16px; }
  .section { padding: 48px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(3) { border-top: 1px solid var(--border); }
}
