*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
}

body {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(61, 186, 160, 0.16), transparent 55%),
    radial-gradient(700px 420px at 90% 10%, rgba(108, 180, 217, 0.12), transparent 50%),
    linear-gradient(165deg, #0b1418 0%, #122028 45%, #0d181d 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.5rem 1.1rem;
  border-right: 1px solid var(--line);
  background: rgba(11, 20, 24, 0.72);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.35rem 0.5rem;
}

.brand-mark {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  background:
    linear-gradient(135deg, var(--accent), #1f6f7a 70%);
  box-shadow: 0 0 0 1px rgba(61, 186, 160, 0.35), 0 10px 30px var(--accent-glow);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 28% 34%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  border-left-color: transparent;
  transform: rotate(-25deg);
}

.brand-name {
  display: block;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.brand-sub {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.is-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(61, 186, 160, 0.18), transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-foot {
  margin-top: auto;
  padding: 0.75rem;
}

.site-chip {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.main {
  padding: 1.5rem 1.75rem 2.5rem;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  animation: rise 480ms ease both;
}

.topbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 2.2vw, 2.1rem);
}

.topbar-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.view {
  display: none;
  animation: rise 420ms ease both;
}

.view.is-visible {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 960px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
