/* App frame: floating sidebar, page header and the notice line. */

.sidebar {
  position: fixed;
  z-index: 5;
  top: var(--gutter);
  bottom: var(--gutter);
  left: var(--gutter);
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 22px 14px 14px;
  overflow-y: auto;
  scrollbar-width: none;
  animation: rise var(--settle) var(--ease) backwards;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.brand__wordmark {
  display: block;
  width: 125px;
  height: auto;
}

.brand--compact .brand__wordmark {
  width: 107px;
}

.brand__mark {
  display: none;
  width: 44px;
  height: 44px;
}

.brand__product {
  padding: 2px 9px;
  border-radius: var(--radius-full);
  background: var(--lime);
  color: var(--navy);
  font-size: var(--text-xs);
  font-weight: 600;
}

.workspace {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 10px;
  border-radius: 18px;
  background: var(--glass-well);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.6);
}

.workspace__text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.workspace__text strong {
  font-weight: 600;
}

.workspace__text small {
  overflow: hidden;
  color: var(--ink-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--navy);
  color: var(--lime);
  font-family: var(--font-display);
  font-size: 1.1875rem;
  line-height: 1;
}

.avatar--small {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: var(--text-md);
}

.nav-label {
  margin: 22px 0 8px;
  padding: 0 10px;
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

.nav {
  position: relative;
  display: grid;
  gap: 2px;
}

.nav__indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--w, 0);
  height: var(--h, 0);
  border-radius: 16px;
  background: var(--glass-fill-strong);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--glass-highlight);
  transform: translate(var(--x, 0), var(--y, 0));
}

.nav__indicator.is-ready {
  transition:
    transform var(--settle) var(--ease),
    width var(--settle) var(--ease);
}

.nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 7px 12px 7px 8px;
  border: 0;
  border-radius: 16px;
  background: none;
  color: var(--ink-muted);
  font-weight: 500;
  text-align: left;
  transition:
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.nav__item:hover {
  color: var(--ink);
  background: rgb(255 255 255 / 0.34);
}

.nav__item[aria-current='page'] {
  color: var(--ink);
  background: none;
  font-weight: 600;
}

.nav__tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.5);
  color: var(--ink);
  transition: background-color var(--medium) var(--ease);
}

.nav__item[aria-current='page'] .nav__tile {
  background: var(--tool-tint);
}

.nav__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav__short {
  display: none;
}

.nav__count {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.sidebar__foot {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}

.credits {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: var(--glass-well);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.6);
}

.credits__glyph {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--lime);
  color: var(--navy);
}

.credits__text {
  display: grid;
  line-height: 1.2;
}

.credits__text strong {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.credits__text small {
  color: var(--ink-muted);
}

.credits__note {
  grid-column: 1 / -1;
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 12px 8px 9px;
  border: 0;
  border-radius: 16px;
  background: none;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: left;
  transition: background-color var(--fast) var(--ease);
}

.account-chip:hover {
  background: rgb(255 255 255 / 0.5);
}

.account-chip__name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main column */

.shell {
  margin-left: calc(var(--sidebar-width) + var(--gutter));
}

main {
  width: min(100%, 1440px);
  margin-inline: auto;
  padding: 34px 40px 56px;
}

main:focus {
  outline: none;
}

.mobile-bar {
  display: none;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  animation: rise var(--settle) var(--ease) backwards;
}

.title {
  position: relative;
  z-index: 0;
  width: fit-content;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.002em;
  text-transform: uppercase;
}

.title__marker {
  position: absolute;
  z-index: -1;
  right: -0.14em;
  bottom: -0.17em;
  left: -0.12em;
  width: calc(100% + 0.26em);
  height: 0.42em;
  overflow: visible;
  fill: none;
  stroke: var(--lime);
  stroke-width: 0.26em;
  stroke-linecap: round;
  animation: draw 460ms var(--ease) both;
}

.title__marker path {
  vector-effect: non-scaling-stroke;
}

@keyframes draw {
  from { clip-path: inset(-100% 100% -100% -5%); }
  to { clip-path: inset(-100% -5% -100% -5%); }
}

.page-head__lede {
  margin-top: 20px;
  font-size: var(--text-lg);
  line-height: 1.4;
}

.page-head__actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
}

.sticker {
  display: inline-block;
  padding: 5px 13px 4px;
  border-radius: 11px;
  background: var(--pink);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transform: rotate(-2.6deg);
  box-shadow: 0 10px 20px -10px rgb(240 0 136 / 0.7);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin-top: 22px;
  padding: 10px 16px 10px 12px;
  border-radius: var(--radius-lg);
  background: var(--glass-fill-strong);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--glass-highlight);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.notice .icon {
  margin-top: 1px;
}

.notice[data-tone='warn'] {
  background: var(--warn-tint);
  color: var(--warn-ink);
}

.notice[data-tone='error'] {
  background: var(--bad-tint);
  color: var(--bad-ink);
}

/* Short laptops: tighten the sidebar before it needs to scroll. */
@media (max-height: 800px) and (min-width: 1100px) {
  .sidebar {
    padding-top: 18px;
  }

  .workspace {
    margin-top: 14px;
  }

  .nav-label {
    margin-top: 12px;
    margin-bottom: 4px;
  }

  .nav__item {
    min-height: 46px;
    padding-block: 5px;
  }

  .credits__note {
    display: none;
  }
}

/* Tablet: the sidebar becomes an icon rail with the same destinations. */
@media (max-width: 1099px) {
  :root {
    --sidebar-width: 84px;
  }

  .sidebar {
    align-items: center;
    padding: 18px 10px 12px;
  }

  .sidebar .brand {
    padding: 0;
  }

  .brand__mark {
    display: block;
  }

  .sidebar .brand__wordmark,
  .brand__product,
  .workspace__text,
  .nav-label,
  .nav__name,
  .nav__count,
  .credits__text small,
  .credits__note,
  .account-chip__name,
  .account-chip .icon {
    display: none;
  }

  .workspace {
    margin-top: 16px;
    padding: 0;
    background: none;
    box-shadow: none;
  }

  .nav {
    margin-top: 16px;
    width: 100%;
  }

  .nav--library {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--hairline);
  }

  .nav__item {
    justify-content: center;
    padding: 7px;
  }

  .credits {
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 4px;
    padding: 8px 6px;
  }

  .credits__text strong {
    font-size: var(--text-sm);
  }

  .account-chip {
    justify-content: center;
    padding: 8px;
  }

  main {
    padding: 28px 28px 48px;
  }
}

/* Phone: a compact top bar, and the tools move to a floating dock. */
@media (max-width: 719px) {
  html {
    scroll-padding-top: 76px;
  }

  body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .shell {
    margin-left: 0;
    padding-top: calc(env(safe-area-inset-top) + 8px);
  }

  .mobile-bar {
    position: sticky;
    z-index: 5;
    top: calc(env(safe-area-inset-top) + 8px);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 10px;
    padding: 6px 6px 6px 14px;
    border-radius: 22px;
  }

  .mobile-bar .brand {
    margin-right: auto;
    padding: 0;
  }

  .credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-full);
    background: var(--lime);
    font-size: var(--text-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  main {
    padding: 24px 16px 24px;
  }

  .page-head {
    display: block;
  }

  .page-head__actions {
    display: none;
  }

  .title {
    font-size: min(2.5rem, 9vw);
  }

  .page-head__lede {
    margin-top: 14px;
    font-size: var(--text-md);
  }

  .notice {
    margin-top: 16px;
  }

  .sidebar {
    inset: auto 10px calc(10px + env(safe-area-inset-bottom));
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    width: auto;
    padding: 6px;
    overflow: visible;
    border-radius: 26px;
  }

  .sidebar > .brand,
  .workspace,
  .nav-label,
  .sidebar__foot,
  #account-nav {
    display: none;
  }

  .sidebar .nav {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .sidebar #tools {
    flex: 4;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0;
  }

  .sidebar .nav--library {
    flex: 1;
  }

  .sidebar .nav__item {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 58px;
    padding: 4px 0;
    border-radius: 20px;
    font-size: 0.71875rem;
    text-align: center;
  }

  .sidebar .nav__item:hover {
    background: none;
  }

  .sidebar .nav__indicator {
    border-radius: 20px;
  }

  .sidebar .nav__name {
    display: block;
    max-width: 100%;
  }

  .nav__full {
    display: none;
  }

  .nav__short {
    display: inline;
  }

  .nav__tile {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: none;
  }
}
