:root {
  --collapsed-width: 116px;
  --expanded-width: 488px;
  --slot-width: 72px;
  --row-height: 72px;
  --row-gap: 4px;
  --accent: #f0702f;
  --morph-duration: 640ms;
  --morph-ease: cubic-bezier(0.3, 1.25, 0.5, 1);
  --settle-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Layout: title bar, 1400px scene, and a bottom bar for the platform's UI. */

.scene {
  position: absolute;
  top: 260px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1080px;
  height: 1400px;
  overflow: hidden;
}

/* Replace scene.svg with a real photo here for an even richer glass effect. */
.scene__image {
  position: absolute;
  inset: 0;
  background: url('scene.svg') center / cover no-repeat;
  transition: filter 800ms ease;
}

.scene.is-night .scene__image {
  filter: brightness(0.42) saturate(0.85);
}

/* Sidebar shell. The toggle and tooltip live outside the clipped panel. */

.sidebar {
  position: relative;
  flex: none;
  width: var(--collapsed-width);
  transition: width var(--morph-duration) var(--morph-ease);
}

.sidebar.is-expanded {
  width: var(--expanded-width);
}

.sidebar__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px 20px;
  border: 2px solid rgb(255 255 255 / 34%);
  border-radius: 56px;
  background-color: rgb(255 255 255 / 12%);
  background-image: linear-gradient(160deg, rgb(255 255 255 / 16%), rgb(255 255 255 / 2%) 45%);
  box-shadow:
    0 40px 90px rgb(30 15 5 / 42%),
    inset 0 2px 2px rgb(255 255 255 / 30%);
  backdrop-filter: blur(30px) saturate(165%);
  transition: background-color 800ms ease;
}

.scene.is-night .sidebar__panel {
  background-color: rgb(16 18 28 / 42%);
}

.sidebar.no-anim,
.sidebar.no-anim *,
.sidebar.no-anim *::before,
.sidebar.no-anim *::after,
.scene.no-anim .scene__image {
  transition: none !important;
}

/* Header */

.head {
  display: flex;
  flex: none;
  align-items: center;
  height: 96px;
  margin-bottom: 12px;
  overflow: hidden;
}

.head__logo {
  display: grid;
  flex: none;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #ff9a5c, var(--accent) 60%, #c94d17);
  font-size: 34px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgb(240 112 47 / 55%);
}

.head__text {
  flex: none;
  margin-left: 20px;
  white-space: nowrap;
}

.head__name {
  display: block;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
}

.head__sub {
  display: block;
  font-size: 22px;
  opacity: 0.72;
}

.toggle {
  position: absolute;
  top: 48px;
  right: -26px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 6px 20px rgb(0 0 0 / 35%);
  cursor: pointer;
}

.toggle svg {
  width: 28px;
  height: 28px;
  transition: transform var(--morph-duration) var(--settle-ease);
}

.sidebar.is-expanded .toggle svg {
  transform: rotate(180deg);
}

/* Rows */

.nav {
  position: relative;
  flex: none;
}

.row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
  height: calc(var(--row-height) * var(--m, 1));
  margin-bottom: var(--row-gap);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 36px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 29px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  text-shadow: 0 1px 8px rgb(0 0 0 / 25%);
}

.slot {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--slot-width);
}

.slot__glyph {
  position: relative;
  width: 36px;
  height: 36px;
  transform: scale(var(--m, 1));
}

.slot__glyph > svg {
  display: block;
  width: 100%;
  height: 100%;
}

.slot__dot {
  position: absolute;
  top: -5px;
  right: -7px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgb(255 255 255 / 45%);
  transition: opacity 200ms ease;
}

.sidebar.is-expanded .slot__dot {
  opacity: 0;
}

/* Text and trailing details fade in once the panel has room for them. */

.fade-in {
  opacity: 0;
  transition: opacity 180ms ease;
}

.sidebar.is-expanded .fade-in {
  opacity: 1;
  transition: opacity 320ms ease 180ms;
}

.row__trail {
  display: flex;
  flex: none;
  align-items: center;
  margin-left: auto;
  padding-left: 16px;
  padding-right: 18px;
}

.count {
  min-width: 46px;
  padding: 2px 12px;
  border-radius: 20px;
  background: rgb(255 255 255 / 24%);
  font-size: 22px;
  font-weight: 600;
  line-height: 32px;
  text-align: center;
}

.count--accent {
  min-width: 38px;
  padding: 2px 6px;
  background: var(--accent);
}

.status-dot {
  width: 15px;
  height: 15px;
  margin-right: 15px;
  border-radius: 50%;
  background: var(--accent);
}

.chevron {
  width: 26px;
  height: 26px;
  margin-right: 10px;
  transition: transform 320ms var(--settle-ease);
}

.sidebar:not(.projects-open) .chevron--tree {
  transform: rotate(180deg);
}

/* Search */

.search {
  flex: none;
  margin-bottom: 8px;
  background: rgb(255 255 255 / 14%);
  font-weight: 400;
}

.kbd {
  padding: 2px 11px;
  border: 1.5px solid rgb(255 255 255 / 32%);
  border-radius: 10px;
  font-size: 20px;
  line-height: 28px;
}

/* Section headers: a label when expanded, a short divider when collapsed. */

.section {
  position: relative;
  height: 28px;
  transition: height var(--morph-duration) var(--settle-ease);
}

.sidebar.is-expanded .section {
  height: 52px;
}

.section__label {
  position: absolute;
  bottom: 12px;
  left: 18px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.1em;
  opacity: 0;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 180ms ease;
}

.sidebar.is-expanded .section__label {
  opacity: 0.68;
  transition: opacity 320ms ease 180ms;
}

.section__divider {
  position: absolute;
  top: 12px;
  left: 21px;
  width: 30px;
  height: 2px;
  background: rgb(255 255 255 / 40%);
  transition: opacity 200ms ease;
}

.sidebar.is-expanded .section__divider {
  opacity: 0;
}

/* Project tree */

.sublist {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 480ms var(--settle-ease);
}

.sidebar.is-expanded.projects-open .sublist {
  grid-template-rows: 1fr;
}

.sublist__inner {
  min-height: 0;
  overflow: hidden;
}

.subrow {
  height: 60px;
  margin-bottom: 0;
  padding-left: var(--slot-width);
  font-size: 26px;
  font-weight: 400;
}

/* Tree line down from the parent icon, with a branch to each child. */
.subrow::before,
.subrow::after {
  content: '';
  position: absolute;
  left: 35px;
  background: rgb(255 255 255 / 34%);
}

.subrow::before {
  top: 0;
  width: 2px;
  height: 100%;
}

.subrow:last-child::before {
  height: 50%;
}

.subrow::after {
  top: 50%;
  width: 24px;
  height: 2px;
}

.subrow__dot {
  flex: none;
  width: 16px;
  height: 16px;
  margin-right: 18px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentcolor;
}

/* Footer */

.foot {
  flex: none;
  margin-top: 16px;
}

.foot__rule {
  height: 2px;
  margin: 8px 0 12px;
  background: rgb(255 255 255 / 18%);
}

.switch {
  position: relative;
  display: block;
  width: 60px;
  height: 34px;
  border-radius: 17px;
  background: rgb(255 255 255 / 28%);
  transition: background-color 300ms ease;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 30%);
  transition: transform 300ms var(--morph-ease);
}

.scene.is-night .switch {
  background: var(--accent);
}

.scene.is-night .switch::after {
  transform: translateX(26px);
}

.user {
  height: 88px;
  margin-bottom: 0;
}

.user__avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(140deg, #f4d9b8, #b57b52);
  color: #3a2415;
  font-size: 24px;
  font-weight: 600;
  text-shadow: none;
}

.user__status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #2fbf71;
}

.user__text {
  margin-left: 14px;
}

.user__name {
  display: block;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.2;
}

.user__mail {
  display: block;
  font-size: 21px;
  font-weight: 400;
  opacity: 0.72;
}

/* Glass pills, moved by SpringPill. Left and top stay 0: it uses transform. */

.pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 36px;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.pill--active {
  border: 2px solid rgb(255 255 255 / 78%);
  background: linear-gradient(180deg, rgb(255 255 255 / 30%), rgb(255 255 255 / 10%));
  box-shadow:
    0 8px 24px rgb(40 20 8 / 30%),
    inset 0 2px 3px rgb(255 255 255 / 45%);
}

.pill--hover {
  background: rgb(255 255 255 / 15%);
  opacity: 0;
}

.pill--hover.is-visible {
  opacity: 1;
}

/* Tooltip shown beside the collapsed icons */

.tooltip {
  position: absolute;
  left: calc(100% + 26px);
  z-index: 3;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 22px;
  border-radius: 20px;
  background: rgb(238 232 226 / 88%);
  color: #2d2520;
  box-shadow: 0 10px 28px rgb(0 0 0 / 30%);
  font-size: 25px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.94);
  transform-origin: left center;
  white-space: nowrap;
  transition: opacity 160ms ease, transform 200ms var(--settle-ease);
}

.tooltip.is-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.tooltip__count {
  min-width: 34px;
  padding: 0 8px;
  border-radius: 12px;
  background: rgb(45 37 32 / 14%);
  font-size: 21px;
  line-height: 30px;
  text-align: center;
}

.tooltip__count:empty {
  display: none;
}
