/**
 * EIBE Workspace 허브 — 화이트 캔버스 + 화이트 타일
 * 임직원몰 · 회의실 목업과 동일 토큰 (#1e2640 · #2eac39)
 */
:root {
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
    "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;

  --bg: #f5f7fb;
  --bg-deep: #eef1f7;
  --text: #1b2438;
  --muted: #5a6476;
  --muted-2: #8a93a3;
  --line: rgba(30, 38, 64, 0.1);
  --dark: #1e2640;
  --dark-2: #151b2e;
  --dark-lift: #2a334f;
  --primary: #2eac39;
  --primary-soft: rgba(46, 172, 57, 0.16);

  --radius-md: 12px;
  --radius-lg: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.hub {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  overflow-x: hidden;
  overflow-y: auto;
}

.hub__deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hub__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 38, 64, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 38, 64, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
}

.hub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(20px, 4vw, 40px);
}

.hub-top__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.hub-mark {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--dark);
}

.hub-mark__sub {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.hub-top__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hub-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hub-user__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--dark);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  flex: none;
}

.hub-user__name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.hub-pill:hover {
  background: var(--dark-lift);
  transform: translateY(-1px);
}

.hub-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(28px, 4vh, 48px);
  padding: 12px clamp(20px, 5vw, 56px) 40px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
}

.hub-top,
.hub-main,
.hub-foot {
  position: relative;
  z-index: 1;
}

.hub-hero {
  animation: hub-rise 0.7s var(--ease) both;
}

.hub-hero__eyebrow {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.hub-hero__title {
  margin: 0;
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--dark);
}

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

@media (min-width: 900px) {
  .hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.hub-tile {
  --i: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  padding: 14px 16px 12px;
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.09);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  animation: hub-rise 0.65s var(--ease) both;
  animation-delay: calc(0.04s * var(--i));
  transition:
    border-color 0.22s ease-out,
    box-shadow 0.22s ease-out;
}

.hub-grid > :nth-child(1) { --i: 1; }
.hub-grid > :nth-child(2) { --i: 2; }
.hub-grid > :nth-child(3) { --i: 3; }
.hub-grid > :nth-child(4) { --i: 4; }
.hub-grid > :nth-child(5) { --i: 5; }
.hub-grid > :nth-child(6) { --i: 6; }
.hub-grid > :nth-child(7) { --i: 7; }
.hub-grid > :nth-child(8) { --i: 8; }
.hub-grid > :nth-child(n + 9) { --i: 9; }

.hub-tile__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}

.hub-tile__status {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ca3af;
}

.hub-tile--status-live .hub-tile__status {
  color: var(--primary);
}

.hub-tile__status--live-bounce {
  display: inline-flex;
  align-items: baseline;
  color: var(--primary);
}

.hub-live-char {
  display: inline-block;
  animation: hub-live-char-pop 1.7s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.28s);
}

@keyframes hub-live-char-pop {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  6% {
    transform: translateY(-5px) scale(1.14);
  }
  12% {
    transform: translateY(0) scale(0.96);
  }
  18% {
    transform: translateY(-2px) scale(1.05);
  }
  24%, 100% {
    transform: translateY(0) scale(1);
  }
}

.hub-tile__id {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.hub-tile__body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 10px;
  min-height: 0;
  text-align: left;
}

.hub-tile__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: #64748b;
}

.hub-tile__icon svg {
  width: 20px;
  height: 20px;
}

.hub-tile--status-live .hub-tile__icon {
  color: var(--primary);
  background: rgba(46, 172, 57, 0.08);
  border-color: rgba(46, 172, 57, 0.12);
}

.hub-tile__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 1px;
}

.hub-tile__name {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.3;
}

.hub-tile__desc {
  font-size: 0.76rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1.45;
}

.hub-tile__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.hub-tile__action-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  transition: color 0.22s ease-out;
}

.hub-tile__action-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  color: #64748b;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease-out,
    background 0.22s ease-out,
    color 0.22s ease-out;
}

.hub-tile__action-arrow svg {
  width: 14px;
  height: 14px;
}

.hub-tile:hover .hub-tile__action-label {
  color: #475569;
}

.hub-tile:hover .hub-tile__action-arrow {
  transform: translateX(2px);
  border-color: rgba(15, 23, 42, 0.12);
  background: #f1f5f9;
  color: #334155;
}

.hub-tile--status-live:hover .hub-tile__action-label {
  color: var(--primary);
}

.hub-tile--status-live:hover .hub-tile__action-arrow {
  border-color: rgba(46, 172, 57, 0.22);
  background: rgba(46, 172, 57, 0.08);
  color: var(--primary);
}

.hub-tile--status-dev:hover .hub-tile__action-label {
  color: #64748b;
}

.hub-tile--status-live:hover {
  border-color: rgba(46, 172, 57, 0.34);
  box-shadow:
    0 0 0 3px rgba(46, 172, 57, 0.07),
    0 8px 20px rgba(15, 23, 42, 0.06);
}

.hub-tile--status-dev:hover {
  border-color: rgba(100, 116, 139, 0.32);
  box-shadow:
    0 0 0 3px rgba(100, 116, 139, 0.06),
    0 8px 20px rgba(15, 23, 42, 0.05);
}

a.hub-tile {
  cursor: pointer;
}

.hub-foot {
  position: relative;
  z-index: 1;
  flex: none;
  padding: 0 clamp(20px, 5vw, 56px) max(28px, env(safe-area-inset-bottom));
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.hub-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px 32px;
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
  box-shadow: 0 10px 28px rgba(15, 27, 51, 0.06);
}

.hub-request__copy {
  flex: 1;
  min-width: 0;
}

.hub-request__eyebrow {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.hub-request__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dark);
}

.hub-request__desc {
  margin: 8px 0 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.5;
  max-width: 52ch;
}

.hub-request__cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.hub-request__cta:hover:not(:disabled) {
  background: var(--dark-lift);
  transform: translateY(-1px);
}

.hub-request__cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hub-request__cta-arrow {
  color: #7be083;
  transition: transform 0.2s var(--ease);
}

.hub-request__cta:hover:not(:disabled) .hub-request__cta-arrow {
  transform: translateX(3px);
}

body.hub-modal-open { overflow: hidden; }

.hub-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.hub-modal.hidden { display: none !important; }

.hub-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.hub-modal__card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 27, 51, 0.22);
  animation: hub-rise 0.35s var(--ease) both;
}

.hub-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.hub-modal__eyebrow {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.hub-modal__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dark);
}

.hub-modal__close {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.hub-modal__close:hover {
  background: #e2e8f0;
  color: var(--dark);
}

.hub-modal__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hub-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-modal__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.hub-modal__select,
.hub-modal__textarea {
  width: 100%;
  border: 1px solid rgba(30, 38, 64, 0.14);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 11px 12px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.hub-modal__textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.hub-modal__select:focus,
.hub-modal__textarea:focus {
  outline: none;
  border-color: rgba(46, 172, 57, 0.55);
  box-shadow: 0 0 0 3px rgba(46, 172, 57, 0.12);
}

.hub-modal__msg {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
}

.hub-modal__msg.is-ok { color: var(--primary); }
.hub-modal__msg.is-err { color: #b42318; }

.hub-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.hub-modal__ghost {
  border: 1px solid rgba(30, 38, 64, 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 12px 16px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.hub-modal__ghost:hover {
  color: var(--dark);
  border-color: rgba(30, 38, 64, 0.22);
}

/* Members 전환 카드 — 다른 페이지와 동일 우측 하단 */
.space-launcher {
  --space-launcher-accent: #3cb34a;
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px 11px 15px;
  color: #f4f6f8;
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 42%),
    rgba(16, 19, 26, 0.92);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 10px 28px rgba(9, 12, 20, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  isolation: isolate;
  animation: space-launcher-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}
.space-launcher::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--space-launcher-accent);
  opacity: 0.72;
  transition: opacity 0.22s ease, top 0.22s ease, bottom 0.22s ease;
}
@keyframes space-launcher-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.space-launcher:hover {
  transform: translateY(-2px) scale(1);
  border-color: rgba(60, 179, 74, 0.38);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 14px 32px rgba(9, 12, 20, 0.34);
}
.space-launcher:hover::before {
  opacity: 1;
  top: 8px;
  bottom: 8px;
}
.space-launcher:focus-visible {
  outline: 2px solid var(--space-launcher-accent);
  outline-offset: 3px;
}
.space-launcher__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
  min-width: 0;
}
.space-launcher__eyebrow {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 246, 248, 0.48);
}
.space-launcher__title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(244, 246, 248, 0.92);
}
.space-launcher__title b {
  font-weight: 750;
  color: #67c872;
}
.space-launcher__arrow {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(103, 200, 114, 0.85);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), color 0.22s ease;
}
.space-launcher:hover .space-launcher__arrow {
  color: #7ad684;
  transform: translateX(3px);
}

@keyframes hub-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .hub-grid { grid-template-columns: 1fr; }
  .hub-user__name { display: none; }
  .hub-request { flex-direction: column; align-items: stretch; }
  .hub-request__cta { justify-content: center; }
  .hub-foot {
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
  .space-launcher {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    gap: 10px;
    padding: 10px 12px 10px 13px;
  }
  .space-launcher__title { font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-hero,
  .hub-tile,
  .hub-modal__card,
  .space-launcher { animation: none; }
  .hub-live-char {
    animation: none;
  }
}
