/* Shared site shell: dark theme tokens + left sidebar navigation.
   Loaded by every page (main, section indexes, realtime typhoon pages). */

:root {
  color-scheme: dark;
  --bg: #0a0e27;
  --bg-warm: #0d1230;
  --surface: #131836;
  --surface-soft: #181e42;
  --surface-strong: #1f2650;
  --ink: #edf0ff;
  --ink-soft: #c6cdf2;
  --muted: #8a93c4;
  --line: #252d5c;
  --line-strong: #37407c;
  --teal: #667eea;
  --teal-dark: #8fa2ff;
  --blue: #a78bfa;
  --amber: #fbbf24;
  --coral: #fb7185;
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #a855f7 100%);
  --shadow: 0 24px 70px rgba(4, 7, 24, 0.55);
  --soft-shadow: 0 12px 34px rgba(4, 7, 24, 0.4);
  --radius: 8px;
  --max-width: 1180px;
  --shell-width: 264px;
  --shell-topbar-height: 60px;
}

html.has-site-shell body {
  padding-left: calc(var(--shell-width) + 20px);
}

.site-shell {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: var(--shell-width);
  padding: 20px 16px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0d1230 0%, #0a0e27 100%);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.shell-brand:hover {
  color: var(--ink);
}

.shell-logo {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 850;
}

.shell-brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.shell-brand-text strong {
  font-size: 1.02rem;
  font-weight: 820;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell-brand-text small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  white-space: nowrap;
}

.shell-nav {
  display: grid;
  gap: 4px;
}

.shell-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.shell-nav a svg {
  flex: 0 0 auto;
  opacity: 0.85;
}

.shell-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}

.shell-nav a.is-active {
  background: rgba(102, 126, 234, 0.18);
  color: #cdd6ff;
}

.shell-cta {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  background: var(--accent-gradient);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(102, 126, 234, 0.28);
}

.shell-cta strong {
  font-size: 0.95rem;
  line-height: 1.3;
}

.shell-cta small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
}

.shell-cta span {
  justify-self: start;
  margin-top: 4px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(10, 14, 39, 0.35);
  font-size: 0.82rem;
  font-weight: 750;
}

.shell-cta:hover {
  color: #fff;
  filter: brightness(1.06);
}

.shell-foot {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.shell-foot a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
  text-decoration: none;
}

.shell-foot a:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

/* Mobile topbar (hamburger toggle) */
.shell-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 41;
  align-items: center;
  gap: 12px;
  height: var(--shell-topbar-height);
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 39, 0.92);
  backdrop-filter: blur(14px);
}

.shell-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
}

.shell-toggle:hover {
  border-color: var(--line-strong);
}

.shell-topbar .shell-brand {
  padding: 0;
  margin: 0;
  border: none;
}

.shell-topbar .shell-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1rem;
}

.shell-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(4, 7, 24, 0.6);
  backdrop-filter: blur(2px);
}

@media (max-width: 980px) {
  html.has-site-shell body {
    padding-left: 0;
    padding-top: calc(var(--shell-topbar-height) + 16px);
  }

  .shell-topbar {
    display: flex;
  }

  .site-shell {
    transform: translateX(-105%);
    transition: transform 240ms ease;
    z-index: 42;
    box-shadow: none;
  }

  html.shell-open .site-shell {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }

  html.shell-open .shell-backdrop {
    display: block;
  }

  html.shell-open body {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-shell {
    transition: none;
  }
}
